package com.educationagent.util;

import dev.langchain4j.data.document.DocumentSource;
import dev.langchain4j.data.document.Metadata;
import org.springframework.web.multipart.MultipartFile;

import java.io.IOException;
import java.io.InputStream;
import java.util.Collections;
import java.util.Map;

public class MultipartFileDocumentSource implements DocumentSource {

    private final MultipartFile file;

    public MultipartFileDocumentSource(MultipartFile file) {
        this.file = file;
    }


    @Override
    public InputStream inputStream() throws IOException {
        return file.getInputStream();
    }

    @Override
    public Metadata metadata() {

        return null;
    }

}
